﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace MemoryLeakViewerLib
{
    public partial class FilterForm : Form
    {
        public FilterForm()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            this.DialogResult = System.Windows.Forms.DialogResult.Cancel;
            this.Close();
        }

        private void okButton_Click(object sender, EventArgs e)
        {
            Program.m_countFilterEnabled = (CountGtCheckBox.CheckState == CheckState.Checked);
            Program.m_countFilterValue = Convert.ToInt32(CountGtTextBox.Text);
            this.DialogResult = System.Windows.Forms.DialogResult.OK;
            this.Close();
        }

        private void FilterForm_Shown(object sender, EventArgs e)
        {
            //this.DialogResult = System.Windows.Forms.DialogResult.Cancel;

            CountGtTextBox.Text = Program.m_countFilterValue.ToString();
            CountGtCheckBox.CheckState = CheckState.Unchecked;
            if (Program.m_countFilterEnabled)
            {
                CountGtCheckBox.CheckState = CheckState.Checked;
            }

            CountGtTextBox.Focus();
        }
    }
}
